//
//  DXBaseService.h
//  iDxyer
//
//  Created by sun black on 11-11-21.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WCApiRequest.h"
#import "NSString+Custom.h"
#import "WCModelHelper.h"

#define kRequestTypeKey     @"ASIHTTPRequestType"

#define NETWORK_ERROR_CODE  312312

#define DefaultSizePerPageString    [NSString stringWithFormat:@"%d",50]

@protocol ServiceDelegate <NSObject>
-(void)requestDidFinishedWithResult:(id)result andUserInfo:(NSDictionary *)userInfo;
-(void)requestDidFailureWithError:(NSError *)error andUserInfo:(NSDictionary *)userInfo;

@end

@interface WCBaseService : NSObject <ASIHTTPRequestDelegate>{
    NSMutableArray *workingRequest;
    __unsafe_unretained id<ServiceDelegate> _delegate;
}

@property(nonatomic,assign) id<ServiceDelegate> delegate;
+(id)serviceWithDelegate:(id<ServiceDelegate>)delegate;
-(id)initWithDelegate:(id<ServiceDelegate>)delegate;

-(void)requestSuccess:(ASIHTTPRequest *)request withJSON:(NSDictionary *)json;

-(void)cancleAllWorkingRequest;

@end
